﻿using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using WpfDemo.Common;
using WpfDemo.ViewModel;
using WpfDemo.ViewModel.Sys;

namespace WpfDemo.View.Sys.Role
{
    /// <summary>
    /// Index.xaml 的交互逻辑
    /// </summary>
    public partial class Index : UserControl
    {       
        
        public Index()
        {
            InitializeComponent();
            WindowManager.WindFrmName = this;
            WindowManager.Regiter<Form> ("RoleForm");

            WindowManager.Regiter<Auth.Index>("AuthIndex");

            this.DataContext = App.ServiceProvider.GetService<RoleViewModel>();
        }
        private void DataGrid_Sorting(object sender, DataGridSortingEventArgs e)
        {
            DataGridColumn column = e.Column;
           
            ListSortDirection? direction = e.Column.SortDirection;
            // 如果是升序排序
            if (direction == ListSortDirection.Ascending)
            {
                // 在这里处理排序后的顺序
            }
            // 如果是降序排序
            else if (direction == ListSortDirection.Descending)
            {
                // 在这里处理排序后的顺序
            }
        }
    }
}
